<template>
	<div class="heightMax publicbox" v-loading='loading'>
		<div class="listName">
			<i></i><span class="font14">相关检验信息</span>
		</div>
		<el-form :model="form" size="mini" ref='form'>
			<!-- <el-form-item label="上次检验日期:">
					<span class="fl">{{form.steelNumber}}</span>
				</el-form-item> -->
			<el-form-item label="下次检验日期:">
				<span class="fl">{{form.next_yearly_inspection_date}}</span>
			</el-form-item>
			<el-form-item label="检验结论:">
				<span class="fl">{{form.inspection_conclusion}}</span>
			</el-form-item>
			<el-form-item label="检验人员:">
				<span class="fl">{{form.inspection_people}}</span>
			</el-form-item>
		</el-form>
	</div>
</template>

<script>
	import {
		loadFn,
		axiosPost,
		axiosGet,
		axiosDelete,
		axiosPut,
		moment
	} from "@/common.js";
	export default {
		mounted() {
			this.getList()
		},
		computed: {
			liftId() {
				if (localStorage.liftDetailId) {
					return JSON.parse(localStorage.liftDetailId).id
				} else {
					return ''
				}
			}
		},
		data() {
			return {
				loading: false,
				form: {
					next_yearly_inspection_date: '',
					inspection_people: '',
					inspection_conclusion: ''
				}
			}
		},
		methods: {
			getList() {
				if (this.liftId) {
					this.loading = true
					let params = {
						id: this.liftId
					}
					axiosGet('/manu/elevator/record/statistics', params, (res) => {
						this.loading = false
						if (res.code == 0) {
							this.form.next_yearly_inspection_date = res.detail.inspection.next_yearly_inspection_date
							this.form.inspection_people = res.detail.inspection.inspection_people
							this.form.inspection_conclusion = res.detail.inspection.inspection_conclusion
						} else {
							this.$message.error(res.detail.result)
						}
					})
				}
			}
		}
	}
</script>

<style scoped lang="less">
	.listName {
		display: flex;
		justify-content: flex-start;
		text-align: left;
		align-items: center;
		margin-bottom: 10px;
		margin-top: 5px;

		i {
			width: 3px;
			height: 15px;
			background: #2d8cf0;
			margin: 5px 5px;
		}
	}

	.el-form {
		padding-left: 20px;
		box-sizing: border-box;
	}
</style>
